/**
 * 根据不同的平台返回对应的bridge
 */

import { IBridge } from "./IBridge";
import WeappBridge from "./weappBridge";


class Bridge{
    private static _instance:IBridge
    static get Instance(){
        if(!Bridge._instance){
            if(IS_WEAPP){
                Bridge._instance = new WeappBridge();
            }else if(IS_RN){
                const NativeBridge = require("./nativeBridge").default;
                Bridge._instance = new NativeBridge();
            }
        }
        return Bridge._instance;
    }
}


export default Bridge;